package jobOO2;

public class Animal {
    String name;
    int age;
    String colour;

    Animal(String name, int age, String colour) {
        this.name = name;
        this.age = age;
        this.colour = colour;
    }

    void drink() {
        System.out.println(name + "正在喝水...");
    }

    void eat() {
        System.out.println(colour + "的、" + age + "岁的" + name + "在吃饭");
    }
}

class Dog extends Animal {
    Dog(String name, int age, String colour) {
        super(name, age, colour);
    }

    void eat() {
        System.out.println(colour + "的、" + age + "岁的" + name + "在吃骨头...");
    }

    void lookHome() {
        System.out.println(colour + "的、" + age + "岁的" + name + "在看家...");
    }
}

class Chick extends Animal {
    Chick(String name, int age, String colour) {
        super(name, age, colour);
    }

    void eat() {
        System.out.println(colour + "的、" + age + "岁的" + name + "在吃小米...");
    }

    void layEaas() {
        System.out.println(colour + "的、" + age + "岁的" + name + "正在下蛋...");
    }
}

class Fish extends Animal {
    Fish(String name, int age, String colour) {
        super(name, age, colour);
    }

    void eat() {
        System.out.println(colour + "的、" + age + "岁的" + name + "在吃小虾...");
    }
}


